using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Spread.Common.Features.Sample;
using FarPoint.Win.Spread;
using Spread.Common.DataStore;

namespace Spread.Skins
{
    public partial class CustomSkins : BaseSampleControl
    {
        SpreadSkinsForm _form;
        public CustomSkins()
        {
            InitializeComponent();
            Name = "Custom Skins";

            sheetView.DataAutoSizeColumns = false;
            sheetView.Columns.Default.Width = 90;
            sheetView.Rows.Default.Height = 25;

            sheetView.DataSource = new DataService().AccessDataSource.GetNWINDData("Products");
            spread.StatusBarVisible = true;

            customizeSkin.Click += CustomizeSkin_Click;
        }

        private void CustomizeSkin_Click(object sender, EventArgs e)
        {
            _form = new SpreadSkinsForm(spread);
            _form.ShowDialog();
        }
    }
}


//
//CustomSkins.Designer.cs
//


namespace Spread.Skins
{
    partial class CustomSkins
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.spread = new FarPoint.Win.Spread.FpSpread();
            this.sheetView = new FarPoint.Win.Spread.SheetView();
            this.customizeSkin = new System.Windows.Forms.Button();
            this.pnlMain.SuspendLayout();
            this.pnlControls.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.spread)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.sheetView)).BeginInit();
            this.SuspendLayout();
            // 
            // pnlMain
            // 
            this.pnlMain.Controls.Add(this.spread);
            // 
            // pnlControls
            // 
            this.pnlControls.Controls.Add(this.customizeSkin);
            // 
            // spread
            // 
            this.spread.Dock = System.Windows.Forms.DockStyle.Fill;
            this.spread.Location = new System.Drawing.Point(0, 0);
            this.spread.Name = "spread";
            this.spread.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
            this.sheetView});
            this.spread.Size = new System.Drawing.Size(477, 487);
            this.spread.TabIndex = 0;
            // 
            // sheetView
            // 
            this.sheetView.Reset();
            this.sheetView.SheetName = "Customize";
            // Formulas and custom names must be loaded with R1C1 reference style
            this.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;
            this.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
            // 
            // customizeSkin
            // 
            this.customizeSkin.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.customizeSkin.Location = new System.Drawing.Point(6, 26);
            this.customizeSkin.Name = "customizeSkin";
            this.customizeSkin.Size = new System.Drawing.Size(148, 23);
            this.customizeSkin.TabIndex = 0;
            this.customizeSkin.Text = "Customize";
            this.customizeSkin.UseVisualStyleBackColor = true;
            // 
            // CustomSkins
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "CustomSkins";
            this.pnlMain.ResumeLayout(false);
            this.pnlControls.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.spread)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.sheetView)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private FarPoint.Win.Spread.FpSpread spread;
        private FarPoint.Win.Spread.SheetView sheetView;
        private System.Windows.Forms.Button customizeSkin;
    }
}
